package com.scs.application.modules.purchase.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.scs.application.core.entity.DataEntity;
import com.scs.application.modules.upgrade.db.annotation.EntityClassAnnotation;
import com.scs.application.modules.upgrade.db.annotation.EntityFieldAnnotation;
import com.scs.application.modules.upgrade.db.annotation.EntityIndexAnnotation;
import com.scs.application.modules.upgrade.db.enums.EntityFieldType;
import lombok.Data;
import lombok.experimental.Accessors;
/**
 * <p>
 * 订单明细
 * </p>
 */
@Data
@Accessors(chain = true)
@EntityClassAnnotation(remark = "采购订单明细表")
@TableName("purchase_order_item")
@EntityIndexAnnotation(ix={"ref_id","order_id","matr_id"})
public class OrderItem extends DataEntity {


    // id ,在父类中处理

    @EntityFieldAnnotation(
            text = "外键",
            type = EntityFieldType.LONG,
            length = "",
            not_null = true,
            default_value = "",
            comment = ""
    )
    private String orderId;

    @EntityFieldAnnotation(
            text = "明细来源",
            type = EntityFieldType.LONG,
            length = "",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private String refId;

    @EntityFieldAnnotation(
            text = "耗材ID",
            type = EntityFieldType.LONG,
            length = "",
            not_null = true,
            default_value = "",
            comment = ""
    )
    private String matrId;

    @EntityFieldAnnotation(
            text = "品名",
            length = "255",
            not_null = true,
            default_value = "",
            comment = ""
    )
    private String matrName;

    @EntityFieldAnnotation(
            text = "品规",
            length = "255",
            not_null = true,
            default_value = "",
            comment = ""
    )
    private String matrSpec;

    @EntityFieldAnnotation(
            text = "包装单位",
            length = "255",
            not_null = true,
            default_value = "",
            comment = ""
    )
    private String packageUnit;

    @EntityFieldAnnotation(
            text = "包装数量",
            type = EntityFieldType.DOUBLE,
            not_null = true,
            default_value = "",
            comment = ""
    )
    private Double packageQty;

    @EntityFieldAnnotation(
            text = "包装比率",
            type = EntityFieldType.DOUBLE,
            not_null = true,
            default_value = "",
            comment = ""
    )
    private Double packageRate;

    @EntityFieldAnnotation(
            text = "单品单位",
            length = "10",
            not_null = true,
            default_value = "",
            comment = ""
    )
    private String skuUnit;

    @EntityFieldAnnotation(
            text = "单品数量",
            type = EntityFieldType.DOUBLE,
            not_null = true,
            default_value = "",
            comment = ""
    )
    private Double skuQty;

    @EntityFieldAnnotation(
            text = "单品单价",
            type = EntityFieldType.DOUBLE,
            length = "",
            not_null = true,
            default_value = "",
            comment = ""
    )
    private Double skuPrice;

    @EntityFieldAnnotation(
            text = "总价",
            type = EntityFieldType.DOUBLE,
            not_null = true,
            default_value = "",
            comment = ""
    )
    private Double amount;

    @EntityFieldAnnotation(
            text = "备注",
            length = "200",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private String remark;

    @EntityFieldAnnotation(
            text = "供方处理状态，0：未确认；1：已确认；2：部分发货；3：全部发货；4：部分入库；5：全部入库；-1：已关闭",
            length = "",
            not_null = true,
            default_value = "0",
            comment = " 供方处理状态"
    )
    private Integer statusSupplier;


    //入库明细数量
    @TableField(exist = false)
    private String inSkuQtySum;

    //入库单号
    @TableField(exist = false)
    private String inKey;

    @EntityFieldAnnotation(
            text = "是临时采购",
            length = "100",
            not_null = false,
            default_value = "0",
            comment = "1:是,0:否"
    )
    private Boolean flagTemporaryPurchase;
    @EntityFieldAnnotation(
            text = "dept_apply_item.id",
            type = EntityFieldType.LONG,
            not_null = false,
            default_value = "",
            comment = ""
    )
    private String applyItemId;

    //入库数量
    @EntityFieldAnnotation(
            text = "入库数量",
            type = EntityFieldType.DOUBLE,
            not_null = true,
            default_value = "0",
            comment = ""
    )
    private Double inSkuQty ;

    @EntityFieldAnnotation(
            text = "入库状态 ",
            length = "",
            not_null = false,
            default_value = "0",
            comment = "0：未入库，1：部分入库，2：全部入库"
    )
    private String statusIn;

    // creator ,在父类中处理


    // gmt_create ,在父类中处理


    // modifier ,在父类中处理


    // gmt_modified ,在父类中处理

    @EntityFieldAnnotation(
            text = "作废标志",
            length = "100",
            not_null = false,
            default_value = "0",
            comment = "1:作废,0:正常"
    )
    private Boolean flagClose;

    @EntityFieldAnnotation(
            text = "作废备注",
            length = "200",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private String closeRemark;

 @EntityFieldAnnotation(
            text = "耗材型号",
            length = "100",
            not_null = false,
            default_value = "",
            comment = "耗材型号"
    )
    private String matrModel;

    @EntityFieldAnnotation(
            text = "包ID",
            type = EntityFieldType.LONG,
            length = "",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private String packId;

    @EntityFieldAnnotation(
            text = "包内耗材对应所在包ID",
            type = EntityFieldType.LONG,
            length = "",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private String orderItemPackId;

    @EntityFieldAnnotation(
            text = "dept_apply_auto.id",
            type = EntityFieldType.LONG,
            not_null = false,
            default_value = "",
            comment = "自动请领id"
    )
    private String applyAutoId;

    @EntityFieldAnnotation(
            text = "0：非包装耗材; 1:跟台包",
            length = "30",
            not_null = false,
            default_value = "0",
            comment = ""
    )
    private String matrType;

}
